<?php


namespace App\Http\Controllers\admin\model;


use Illuminate\Support\Facades\DB;

class AppInstallModel
{
    public static function delete($where){
        return DB::table('t_app_install')->where($where)->delete();
    }

    public static function queryFirst($where,$field){
        return DB::table('t_app_install')->where($where)->first($field);
    }

    public static function queryWhereGet($where,$field){
        return DB::table('t_app_install')->where($where)->get($field);
    }

    public static function queryLikeParent($where,$field){
        return DB::table('t_app_install as a')
            ->leftJoin('t_parent_app as p','a.parent_app_id','=','p.id')
            ->where($where)
            ->first($field);
    }

    public static function queryLikeTeacher($where,$field){
        return DB::table('t_app_install as a')
            ->leftJoin('t_teacher_app as t','a.teacher_app_id','=','t.id')
            ->where($where)
            ->first($field);
    }

}